<?php
// No direct access
defined('_JEXEC') or die;
?>

<script type="text/javascript">
	jQuery().ready(function($){
		$('a.gs-title').live('click', function(){
			$(this).attr('target', '_self');
		});
	});
</script>

<div id="cse" style="width: 100%;">Loading</div>
<script src="//www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript"> 
  function parseQueryFromUrl () {
    var queryParamName = "q";
    var search = window.location.search.substr(1);
    var parts = search.split('&');
    for (var i = 0; i < parts.length; i++) {
      var keyvaluepair = parts[i].split('=');
      if (decodeURIComponent(keyvaluepair[0]) == queryParamName) {
        return decodeURIComponent(keyvaluepair[1].replace(/\+/g, ' '));
      }
    }
    return '';
  }

  google.load('search', '1', {language : 'vi', style : google.loader.themes.MINIMALIST});
  google.setOnLoadCallback(function() {
    var customSearchControl = new google.search.CustomSearchControl(
      '009401644940279006493:zpbpmbkghiw');

    customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
    var options = new google.search.DrawOptions();
    options.enableSearchResultsOnly(); 
    customSearchControl.draw('cse', options);
    var queryFromUrl = parseQueryFromUrl();
    if (queryFromUrl) {
      customSearchControl.execute(queryFromUrl);
    }
  }, true);
</script>
 
 <style>
<!--
/* search */
a.gs-title, a.gs-title b, div.gs-bidi-start-align, .titleLink {
	font-size: 13px !important;
}

a.gs-title, a.gs-title b {
	color: blue !important;
}

.sr-div, .descText, .sl-table-ol td, .sl-table td, .ctcT a {
	font-size: 13px !important;
}
-->
</style>